package cn.siat.gene.controller;


import com.alibaba.fastjson.JSONArray;
import cn.siat.common.core.web.controller.BaseController;
import cn.siat.common.core.web.domain.AjaxResult;
import cn.siat.common.redis.service.RedisService;
import cn.siat.gene.service.GenePoolService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/genePool")
@RequiredArgsConstructor
public class GenePoolController extends BaseController {

    private final GenePoolService genePoolService;

    /**
    * 获取基因库列表
    */
    @PostMapping("/geneData")
    public AjaxResult geneData(String assembly_accession) {
        return AjaxResult.success(genePoolService.geneList(assembly_accession));
    }

    /**
     * 从基因库文件创建方案
     * @param files
     * @param programmeId
     * @return
     */
    @PostMapping("/geneFiles")
    public AjaxResult geneFiles(String files, String programmeId) {
        genePoolService.geneFiles(files,programmeId);
        return AjaxResult.success();
    }

}
